import { http } from "@/utils/http";
import type { BannerItem, CategoryItem, HotItem, GuessItem } from "@/types/home";
import type { PageResult, PageParams } from "@/types/global";

// 获取广告区域轮播图
export const getHomeBannerAPI = (distributionSite = 1) => {
  return http<BannerItem[]>({
    url: "/home/banner",
    method: "GET",
    data: {
      distributionSite
    }
  })
}

// 获取前台分类
export const getCategoryAPI = () => {
  return http<CategoryItem[]>({
    url: "/home/category/mutli",
    method: "GET",
  })
}

// 获取热门推荐
export const getHomeHotAPI = () => {
  return http<HotItem[]>({
    url: "/home/hot/mutli",
    method: "GET",
  })
}

// 获取猜你喜欢
export const getHomeGoodsGuessLikeAPI = (data?: PageParams) => {
  return http<PageResult<GuessItem>>({
    url: "/home/goods/guessLike",
    method: "GET",
    data
  })
}



